package 创建型模型.工厂模式.抽象工厂模式;

public interface Factory {
    void createEngine();
    void createTyre();
}

class BMWFactory implements Factory{

    @Override
    public void createEngine() {
        Engine e=new HighEngine();
        e.run();
    }

    @Override
    public void createTyre() {
        Tyre t=new HighTyre();
        t.run();
    }
}
class BYDFactory implements Factory{

    @Override
    public void createEngine() {
        Engine e=new LowEngine();
        e.run();
    }

    @Override
    public void createTyre() {
        Tyre t=new LowTyre();
        t.run();
    }
}